\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{isdoc}[2007/10/09 Clase para la documentación de IS]

\LoadClass[letterpaper,11pt,leqno]{article}
\RequirePackage[utf8]{inputenc}
\RequirePackage{ae}
\RequirePackage{graphicx}
\RequirePackage[right=2.5cm,left=2.5cm]{geometry}

\AtBeginDocument{%
  \pagestyle{plain}%
  \thispagestyle{firstpage}%
}

\newsavebox{\@version}
\newcommand{\version}[1]{\sbox{\@version}{#1}}
\renewcommand{\today}{\number\day\space de\space \ifcase\month\or
  Enero\or Febrero\or Marzo\or Abril\or Mayo\or Junio\or
  Julio\or Agosto\or Septiembre\or Octubre\or Noviembre\or
  Diciembre\fi\space del \space\number\year}

\renewcommand{\maketitle}{%
  \begin{center}
    {\LARGE \@title}
  \end{center}
}

\newcommand{\ps@firstpage}{%
  \renewcommand{\@oddfoot}{%
    \makebox[0cm][l]{\small Version \usebox{\@version}}%
    \makebox[\textwidth]{\small Quimera}%
    \makebox[0cm][r]{\thepage}}%
  \renewcommand{\@oddhead}{%
    \includegraphics[width=2cm]{logo}%
    \hfil\today}%
  \addtolength{\headheight}{2cm}
}

\renewcommand{\ps@plain}{%
  \renewcommand{\@oddfoot}{%
    \makebox[0cm][l]{\small Version \usebox{\@version}}%
    \makebox[\textwidth]{\small Quimera}%
    \makebox[0cm][r]{\thepage}}%
  \renewcommand{\@oddhead}{%
    \@title\hfil\today}%
  \setlength{\headheight}{1cm}%
  \addtolength{\textheight}{2cm}%
}


%% Comandos para Casos de Uso

\newcounter{paso}

\newenvironment{flujo}%
{%
  \setcounter{paso}{0}
  $\;$\\
  \begin{tabular}[t]{|c|p{5.5cm}|c|p{5.5cm}|c|}
    \hline
    \multicolumn{2}{|c|}{Actor} & \multicolumn{3}{|c|}{Sistema} \\\hline
    Paso & \multicolumn{1}{|c|}{Acción} & Paso & \multicolumn{1}{|c|}{Acción} & Excep \\
    \hline
}{\end{tabular}}

\newcommand{\fila}[3][ ]{%
  \addtocounter{paso}{1}\thepaso & #2 & \addtocounter{paso}{1}\thepaso & #3 & #1 \\\hline
}

\newenvironment{excepciones}%
{%
  $\;$\\
  \begin{tabular}[t]{|c|p{6cm}|p{8cm}|}
    \hline
    ID & Condición & Acción \\
    \hline
}{\end{tabular}}

\newcommand{\excepcion}[3]{%
  #1 & #2 & #3 \\\hline
}